package com.cipe.cmrs.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.cipe.cmrs.util.DateUtil2;

@MappedSuperclass
public abstract class AbstractModification extends BaseAuditEntity {
    /**
     * 
     */
    private static final long serialVersionUID = -6525888434093660248L;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "modificationtypeid")
    private Modificationtype modificationType;

    @Column(name = "modifiedfrom")
    private String modifiedFrom;

    @Column(name = "modifiedto")
    private String modifiedTo;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "modifieddate")
    private Date modifiedDate;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "modifiedby")
    private User modifiedBy;

    @Column(name = "attachment")
    private String attachment;

    public Modificationtype getModificationType() {
        return modificationType;
    }

    public void setModificationType(Modificationtype modificationType) {
        this.modificationType = modificationType;
    }

    public String getModifiedFrom() {
        return modifiedFrom;
    }

    public void setModifiedFrom(String modifiedFrom) {
        this.modifiedFrom = modifiedFrom;
    }

    public String getModifiedTo() {
        return modifiedTo;
    }

    public void setModifiedTo(String modifiedTo) {
        this.modifiedTo = modifiedTo;
    }

    public Date getModifiedDate() {
        return modifiedDate;
    }

    public String getFormattedModifiedDate() {
        return DateUtil2.INSTANCE.formatDate(modifiedDate);
    }

    public void setModifiedDate(Date modifiedDate) {
        this.modifiedDate = modifiedDate;
    }

    public User getModifiedBy() {
        return modifiedBy;
    }

    public void setModifiedBy(User modifiedBy) {
        this.modifiedBy = modifiedBy;
    }

    public String getAttachment() {
        return attachment;
    }

    public void setAttachment(String attachment) {
        this.attachment = attachment;
    }

}
